Today is
Saturday,
May 18th
2024
Circuit Board

This section gives some basic electronics and robotics information along with helpful links. I also detail a lot of my projects. For most of them I've included schematics. I use ExpressSCH for drawing them and ExpressPCB for designing circuit boards. They are a free package from expresspcb.com. You can download for free and get your boards professionally manufactured for very reasonable prices. Of course, with the final layout you can also etch your own boards at home if you choose.

May 17, 2011

My First Microcontroller Project

I have plans to build several animatronic Halloween props, so I began looking into microcontrollers to run them. I want with Atmel due to their availability, functionality and popularity. This is a very simple initial project to ensure that I'm off on the right foot. Being on a MAC, I had to do a little more looking for a good programming platform, but settled on Eclipse. I'm using a USBtiny ISP for programming, with my code written in C. I won't go through all the details of setup, but if you're interested, there is an excellent article here.

Here is the code for this simple project which utilizes an ATTINY13 chip to blink an LED at 1Hz:

/*
*
* Created on: May 8, 2011
* Author: brianredmond
*/
#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
      DDRB=0x1F;
      PORTB=0x00;

      for(;;)
      {
           PORTB |=(1<<4);
           _delay_ms(1000);

           PORTB &= ~(1<<4);
           _delay_ms(1000);
      }
}

ISP pin layout
The six pin connector on the USBtiny can be a little confusing. Here's a pin diagram as if you're looking down on the connection side (note the red stripe).

Schematic
This schematic shows the ISP as six pins in a line as opposed to the actual two rows of three. The chip is actually powered during programming from the 5 volts coming in from the USB.

Breadboard
Here is the breadboard layout.

Video
Here's a video of the exciting action.

Other Projects
My second microcontroller project - June 18, 2011
An audio controlled servo - June 1, 2011
I built a motion controlled cat fountain - March 24, 2011
A 555 timer project - December 17, 2009
A basic line-following robot - March 11, 2009